﻿<%@ Page Language="C#" MasterPageFile="~/cms/cms.master" AutoEventWireup="true" CodeFile="userlist.aspx.cs" Inherits="cms_userlist" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="main-title">Danh sách người sử dụng:</div>
    <div class="main-content">
        <asp:GridView ID="gvUsers" runat="server" AutoGenerateColumns="false"
            BorderStyle="None" DataKeyNames="UserName" Width="100%" DataSourceID="odsMembership">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblUName" ForeColor="Blue"
                         Text='<%# Eval("UserName") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left" Width="120px" />
                </asp:TemplateField>
                <asp:BoundField DataField="Email" HeaderText="Địa chỉ email" >
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="CreationDate" HeaderText="Ngày đăng ký" DataFormatString="{0:dd/M/yyyy}">
                    <ItemStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="LastLoginDate" HeaderText="Đăng nhập cuối" DataFormatString="{0:dd/M/yyyy}">
                    <ItemStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:TemplateField ShowHeader="False" HeaderText="Xóa">
                    <ItemTemplate>
                        <asp:ImageButton ID="ibtDelete" runat="server" ImageUrl="~/images/delete_over.gif" 
                            onclientclick="return confirm('Bạn có chắc chắn muốn loại tài khoản này khỏi nhóm?');"
                            CommandName="Delete" ToolTip="Xóa tài khoản này" />
                    </ItemTemplate>
                    <ItemStyle Width="40px" HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="gridHeader" />
            <RowStyle CssClass="gridRow" />
            <PagerStyle CssClass="gridPage" />
            <FooterStyle CssClass="gridFooter" />
            <EmptyDataTemplate>
                Chưa có tài khoản nào trong nhóm.
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:ObjectDataSource ID="odsMembership" runat="server" TypeName="System.Web.Security.Membership" 
            SelectMethod="GetAllUsers" DeleteMethod="DeleteUser">
        </asp:ObjectDataSource>
    </div>
</asp:Content>

